<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>


<script>

     var user = {};

     user.id = 1
     user.name = "张三"

     //我们说的前端参数打包提交就和我们后端定义一个user对象，我可以通过setId,
     //setName 设置参数一个道理，js里面只是没有setXXX 而是直接对象名.属性就可以复制
     console.log(user);


</script>
</body>
</html>
